﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using System.Data;
using System.Data.SqlClient;

namespace DAO
{
    public class HoaDonThuoc_DAO
    {

        public static string ThemHoaDonThuocOut(HoaDonThuoc_DTO HoaDonThuocDto)
        {
            List<SqlParameter> ParaArr = new List<SqlParameter>();
            string procname = "sp_ThemHDThuoc";
            ParaArr.Add(new SqlParameter("@NgayLap", HoaDonThuocDto.NgayLap));
            ParaArr.Add(new SqlParameter("@ThanhTien", HoaDonThuocDto.ThanhTien));
            ParaArr.Add(new SqlParameter("@MaNV", HoaDonThuocDto.MaNV));
            ParaArr.Add(new SqlParameter("@MaBN", HoaDonThuocDto.MaBN));
            SqlParameter output = new SqlParameter("@MaHDThuoc", SqlDbType.NChar, 10);
            SqlCommand cmd = DataProvider.OutPutProc(procname, ParaArr, output);
            return cmd.Parameters["@MaHDThuoc"].Value.ToString();
        }
    }
}
